import request from '@/config/axios'

//获取全局变量
export const getGlobalList = async () => {
  return await request.get({ url: '/globalVarsManage/formList' })
}

//更新全局变量
export const updateGlobal = async (data) => {
  return await request.post({ url: '/globalVarsManage/addOrEditGlobalVars', data })
}

//获取环境列表
export const getEnvironmentList = async () => {
  return await request.get({ url: '/sysEnvManage/formList' })
}

//删除环境列表
export const deleteEnvironment = async (id) => {
  return await request.delete({ url: '/sysEnvManage/deleteSystemEnvById?id=' + id })
}

//获取环境变量
export const getEnvironment = async (params) => {
  return await request.get({ url: '/envVarsManage/formList', params })
}

//获取前置URL
export const getServiceURL = async (params) => {
  return await request.get({ url: '/envServiceManage/formList', params })
}

//更新环境
export const updateEnvironment = async (data) => {
  return await request.post({ url: '/sysEnvManage/addOrEditSystemEnv', data })
}
